import time

from selenium.webdriver.common.by import By

from common.DriverTools import DriverTools


class HomePage(object):
    def __init__(self):
        self.driver = DriverTools().get_driver()
        # 登陆按钮
        self.login_btn = (By.LINK_TEXT, '登录')

    # 进入登陆页面
    def goto_login_page(self):
        self.driver.find_element(*self.login_btn).click()


if __name__ == '__main__':
    driver = DriverTools.get_driver()
    driver.get("http://hmshop-test.itheima.net/")
    time.sleep(3)
    HomePage().goto_login_page()
    time.sleep(3)
    driver.quit()
